package com.baidu.fsg.uid.utils;

import cn.hutool.core.date.DatePattern;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * @Description:
 * @author: Sylar
 * @date: 2021年10月26日 5:34 下午
 */
public class DateUtils {

    public static String format(Long timestamp) {
        Instant instant = Instant.ofEpochMilli(timestamp);
        ZoneId zone = ZoneId.systemDefault();
        LocalDateTime dateTime = LocalDateTime.ofInstant(instant, zone);
        return dateTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_MS_PATTERN));
    }
}
